package com.hmall.feign.client;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.SearchParams;
import com.hmall.common.dto.SearchVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Author lyh
 * @Date 2024/11/11 11:39
 */
@FeignClient(value = "itemservice")
@RequestMapping("/item")
public interface ItemClient {
    @GetMapping("/filters")
    public SearchVo fliters(@RequestBody SearchParams searchParams);

    @GetMapping("/list1")
    public PageDTO list(@RequestBody SearchParams searchParams);
    @GetMapping("/{id}")
    public Item getById(@PathVariable Long id);
    @PutMapping("/stock/{itemId}/{num}")
    public void decreamStock(@PathVariable Long itemId,@PathVariable Integer num);
    @PutMapping("/{itemId}/{num}")
    public void recoverStock(@PathVariable Long itemId,@PathVariable Integer num);
}
